package calculator;

import java.lang.reflect.InvocationTargetException;

public class Invoker {

	public String go(Object c, String method, Object[] params) throws NoSuchMethodException, 
								IllegalAccessException, InvocationTargetException {
		Class<?>[]
		         classes = new Class<?>[params.length];
		for (int i = 0; i < params.length; i++) {
			classes[i] = params [i].getClass();
		}
		return c.getClass().getMethod(method, classes).invoke(c, params).toString();
	}
	
	

}
